using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using System.Configuration;
using Bussiness.Config;     
using Bussiness.Entity;
namespace Bussiness.ManagerBase
{
                

     public abstract class PT_Role_FunctionManagerBase
    {
        public PT_Role_FunctionManagerBase()
        {
            Adapter.ConnectionString =  ConnectionConfig.ConnectionString;            
        }
                    
 
        /// <summary>
        /// Them moi du lieu
        /// </summary>
        /// <returns>PT_Role_FunctionEntity</returns>
        public PT_Role_FunctionEntity Insert(PT_Role_FunctionEntity obj)
        { 
            return (PT_Role_FunctionEntity) Adapter.Insert(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo khoa chinh cua object
        /// </summary>
        /// <returns>PT_Role_FunctionEntity</returns>
        public PT_Role_FunctionEntity Update(PT_Role_FunctionEntity obj)
        { 
            return (PT_Role_FunctionEntity)Adapter.Update(obj);             
        }
 
 
        public PT_Role_FunctionEntity Delete(PT_Role_FunctionEntity obj)
        { 
            return (PT_Role_FunctionEntity)Adapter.Delete(obj);             
        }
 


        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien RoleId duoc set trong object
        /// </summary>
        /// <returns>PT_Role_FunctionEntity</returns>
        public PT_Role_FunctionEntity DeleteByRoleId (PT_Role_FunctionEntity obj)
        { 
            return (PT_Role_FunctionEntity)Adapter.DeleteByField(obj,"RoleId");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien RoleId 
        /// </summary>
        /// <returns>PT_Role_FunctionEntity</returns>
        public PT_Role_FunctionEntity DeleteByRoleId (int RoleId )
        { 
            PT_Role_FunctionEntity obj = new PT_Role_FunctionEntity();
            obj.RoleId = RoleId;  
            return (PT_Role_FunctionEntity)Adapter.DeleteByField(obj,"RoleId");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien FunctionId duoc set trong object
        /// </summary>
        /// <returns>PT_Role_FunctionEntity</returns>
        public PT_Role_FunctionEntity DeleteByFunctionId (PT_Role_FunctionEntity obj)
        { 
            return (PT_Role_FunctionEntity)Adapter.DeleteByField(obj,"FunctionId");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien FunctionId 
        /// </summary>
        /// <returns>PT_Role_FunctionEntity</returns>
        public PT_Role_FunctionEntity DeleteByFunctionId (int FunctionId )
        { 
            PT_Role_FunctionEntity obj = new PT_Role_FunctionEntity();
            obj.FunctionId = FunctionId;  
            return (PT_Role_FunctionEntity)Adapter.DeleteByField(obj,"FunctionId");
        }

 
        /// <summary>
        /// Lay du lieu theo khoa chinh object
        /// </summary>
        /// <returns></returns>
        public PT_Role_FunctionEntity Select(PT_Role_FunctionEntity obj)
        { 
            return (PT_Role_FunctionEntity) Adapter.Select(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(PT_Role_FunctionEntity obj)
        { 
            return  Adapter.SelectWithCondition(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(PT_Role_FunctionEntity obj,SelectOptions option)
        {             
            return  Adapter.SelectWithCondition(obj,option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll()
        { 
            return Adapter.SelectAll(new PT_Role_FunctionEntity());             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll(SelectOptions option)
        { 
            return Adapter.SelectAll(new PT_Role_FunctionEntity(),option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<PT_Role_FunctionEntity> SelectAllLST()
        { 
            return  (List<PT_Role_FunctionEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new PT_Role_FunctionEntity()),new PT_Role_FunctionEntity());           
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<PT_Role_FunctionEntity> SelectAllLST(SelectOptions option)
        { 
            return (List<PT_Role_FunctionEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new PT_Role_FunctionEntity(),option),new PT_Role_FunctionEntity());             
        }
 

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByRoleId (PT_Role_FunctionEntity obj)
        { 
            return Adapter.SelectByField(obj,"RoleId");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByRoleId (PT_Role_FunctionEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"RoleId",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId duoc set trong object
        /// </summary>
        /// <returns>List<PT_Role_FunctionEntity></returns>
        public List<PT_Role_FunctionEntity> SelectByRoleIdLST (PT_Role_FunctionEntity obj)
        { 
            return  (List<PT_Role_FunctionEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"RoleId"),new PT_Role_FunctionEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId duoc set trong object
        /// </summary>
        /// <returns>List<PT_Role_FunctionEntity></returns>
        public List<PT_Role_FunctionEntity> SelectByRoleIdLST (PT_Role_FunctionEntity obj,SelectOptions option)
        { 
            return  (List<PT_Role_FunctionEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"RoleId",option),new PT_Role_FunctionEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByRoleId (int RoleId )
        { 
            PT_Role_FunctionEntity obj = new PT_Role_FunctionEntity();
            obj.RoleId = RoleId;  
            return Adapter.SelectByField(obj,"RoleId");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByRoleId (int RoleId, SelectOptions option)
        { 
            PT_Role_FunctionEntity obj = new PT_Role_FunctionEntity();
            obj.RoleId = RoleId;  
            return Adapter.SelectByField(obj,"RoleId",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_Role_FunctionEntity> SelectByRoleIdLST (int RoleId )
        { 
            PT_Role_FunctionEntity obj = new PT_Role_FunctionEntity();
            obj.RoleId = RoleId;  
            return  (List<PT_Role_FunctionEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"RoleId"),new PT_Role_FunctionEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_Role_FunctionEntity> SelectByRoleIdLST (int RoleId, SelectOptions option)
        { 
            PT_Role_FunctionEntity obj = new PT_Role_FunctionEntity();
            obj.RoleId = RoleId;  
            return  (List<PT_Role_FunctionEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"RoleId",option),new PT_Role_FunctionEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FunctionId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByFunctionId (PT_Role_FunctionEntity obj)
        { 
            return Adapter.SelectByField(obj,"FunctionId");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FunctionId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByFunctionId (PT_Role_FunctionEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"FunctionId",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FunctionId duoc set trong object
        /// </summary>
        /// <returns>List<PT_Role_FunctionEntity></returns>
        public List<PT_Role_FunctionEntity> SelectByFunctionIdLST (PT_Role_FunctionEntity obj)
        { 
            return  (List<PT_Role_FunctionEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"FunctionId"),new PT_Role_FunctionEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FunctionId duoc set trong object
        /// </summary>
        /// <returns>List<PT_Role_FunctionEntity></returns>
        public List<PT_Role_FunctionEntity> SelectByFunctionIdLST (PT_Role_FunctionEntity obj,SelectOptions option)
        { 
            return  (List<PT_Role_FunctionEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"FunctionId",option),new PT_Role_FunctionEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FunctionId 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByFunctionId (int FunctionId )
        { 
            PT_Role_FunctionEntity obj = new PT_Role_FunctionEntity();
            obj.FunctionId = FunctionId;  
            return Adapter.SelectByField(obj,"FunctionId");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FunctionId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByFunctionId (int FunctionId, SelectOptions option)
        { 
            PT_Role_FunctionEntity obj = new PT_Role_FunctionEntity();
            obj.FunctionId = FunctionId;  
            return Adapter.SelectByField(obj,"FunctionId",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FunctionId 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_Role_FunctionEntity> SelectByFunctionIdLST (int FunctionId )
        { 
            PT_Role_FunctionEntity obj = new PT_Role_FunctionEntity();
            obj.FunctionId = FunctionId;  
            return  (List<PT_Role_FunctionEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"FunctionId"),new PT_Role_FunctionEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FunctionId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_Role_FunctionEntity> SelectByFunctionIdLST (int FunctionId, SelectOptions option)
        { 
            PT_Role_FunctionEntity obj = new PT_Role_FunctionEntity();
            obj.FunctionId = FunctionId;  
            return  (List<PT_Role_FunctionEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"FunctionId",option),new PT_Role_FunctionEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<PT_Role_FunctionEntity></returns>
        public List<PT_Role_FunctionEntity> SelectWithConditionLST (PT_Role_FunctionEntity obj)
        { 
            return  (List<PT_Role_FunctionEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj),new PT_Role_FunctionEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<PT_Role_FunctionEntity></returns>
        public List<PT_Role_FunctionEntity> SelectWithConditionLST (PT_Role_FunctionEntity obj,SelectOptions option)
        { 
            return  (List<PT_Role_FunctionEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj,option),new PT_Role_FunctionEntity());
        }

}
}
